cmake_minimum_required(VERSION 3.16)
project(DatabaseTool)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find Qt packages
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Sql)

# Add the executable
add_executable(${PROJECT_NAME}
    src/main.cpp
    src/mainwindow.cpp
    src/mainwindow.h
    src/databaseconnection.cpp
    src/databaseconnection.h
    src/databaseexplorer.cpp
    src/databaseexplorer.h
    src/sqleditor.cpp
    src/sqleditor.h
    src/tablemodel.cpp
    src/tablemodel.h
    src/dataexplorer.cpp
    src/dataexplorer.h
    src/dataexporter.cpp
    src/dataexporter.h
    src/dataimporter.cpp
    src/dataimporter.h
    src/tabmanager.cpp
    src/tabmanager.h
    src/connectionmanager.cpp
    src/connectionmanager.h
    src/connectiondialog.cpp
    src/connectiondialog.h
    src/connectionwindow.cpp
    src/connectionwindow.h
    src/importdialog.cpp
    src/importdialog.h
    src/erdiagramview.cpp
    src/erdiagramview.h
    src/databasediff.cpp
    src/databasediff.h
    src/diffdialog.cpp
    src/diffdialog.h
    src/datagenerator.cpp
    src/datagenerator.h
    src/datagendialog.cpp
    src/datagendialog.h
    src/pluginmanager.cpp
    src/pluginmanager.h
    src/plugininterface.h
    src/dbtoolplugininterface.h
    src/databasespecificmanager.cpp
    src/databasespecificmanager.h
    src/databaseinfodialog.cpp
    src/databaseinfodialog.h
    src/sqlformatter.cpp
    src/sqlformatter.h
    src/queryhistorymanager.cpp
    src/queryhistorymanager.h
    src/queryhistorydialog.cpp
    src/queryhistorydialog.h
    src/bookmarkmanager.cpp
    src/bookmarkmanager.h
    src/bookmarkdialog.cpp
    src/bookmarkdialog.h
    src/sqlautocomplete.cpp
    src/sqlautocomplete.h
    src/sqlhighlighter.cpp
    src/sqlhighlighter.h
    src/sqltextedit.cpp
    src/sqltextedit.h
)

# Link Qt libraries
target_link_libraries(${PROJECT_NAME} 
    Qt6::Core
    Qt6::Widgets
    Qt6::Sql
)